<md-dialog flex="60">
    <form novalidate name="permissionForm" class="form-horizontal">
    <md-toolbar>
        <div class="md-toolbar-tools">
            <h2 ng-show="isAddAction">Add Permission</h2>
            <h2 ng-show="!isAddAction">Edit Permission</h2>
        </div>
    </md-toolbar>
    <md-dialog-content class="" style="padding: 40px 40px 10px 14px;">
        <div class="form-group">
            <label class="control-label col-md-2">Name:</label>
            <div class="col-md-10">
                <input-validation-message field="permission" form="permissionForm"></input-validation-message>
                <input class="form-control" name="permission" type="text"
                       ng-model="permission.name" required="true"/>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-md-2">Group:</label>
            <div class="col-md-10">
                <input-validation-message field="Group" form="permissionForm"></input-validation-message>
                <ui-select name="category" ng-model="permission.groupName" required="true">
                    <ui-select-match>
                        <div ng-bind="$select.selected"></div>
                    </ui-select-match>
                    <ui-select-choices repeat="item  in ['Other', 'Foundation Data']">
                        {{item}}
                    </ui-select-choices>
                </ui-select>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-md-2">Category:</label>
            <div class="col-md-10">
                <input-validation-message field="category" form="permissionForm"></input-validation-message>
                <ui-select name="category" ng-model="permission.category" required="true">
                    <ui-select-match>
                        <div ng-bind="$select.selected"></div>
                    </ui-select-match>
                    <ui-select-choices repeat="item  in ['WEB', 'ANDROID', 'API', 'ALL']">
                        {{item}}
                    </ui-select-choices>
                </ui-select>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-md-2">Description:</label>
            <div class="col-md-10">
                <textarea class="form-control" name="description"  rows="4"
                            ng-model="permission.description" ></textarea>
            </div>
        </div>
    </md-dialog-content>
    <md-dialog-actions layout="row">
        <div style="margin-right: 50px">
            <button type="submit" ng-click="permissionForm.$valid && saveOrUpdate()"  class="btn blue ">Submit</button>
            <button type="button" ng-click="cancel() " class="btn default ">Cancel</button>
        </div>
    </md-dialog-actions>
    </form>

</md-dialog>

